<?php $menuHelper = Mage::helper('megamenu'); ?>
<?php $menuData = $menuHelper->getMenuData(); extract($menuData); ?>
<?php $only_categories = $this->getOnlyCategories(); ?>
<ul class="menu side-menu">
    <?php echo $menuHelper->getMenuContent($only_categories); ?>
</ul>
<script type="text/javascript">
//<![CDATA[
var SW_MENU_POPUP_WIDTH = <?php echo $_popupWidth; ?>;
jQuery(function($){
    $('.menu.side-menu').et_menu({
        type: "default",
        delayTime: <?php echo $menuHelper->getConfig('popup/popup_delay'); ?>
    });
});
<?php if($menuHelper->getConfig('popup/ajax_load_popups')): ?>
jQuery(function($){
    $(document).ready(function(){
        url = "<?php echo Mage::getBaseUrl()."swmegamenu/index/showpopup" ?>";
        $("ul.menu.side-menu > li.menu-static-width, ul.menu.side-menu > li.menu-full-width, ul.menu.side-menu > li.menu-item").off("mouseover").on("mouseover",function(){
            if(!$(this).hasClass("ajax-loaded") && !$(this).hasClass("ajax-loading") && $(this).attr("data-id")) {
                var cur_menu_item = $(this);
                param = "?category_id="+$(this).attr("data-id");
                $(cur_menu_item).addClass("ajax-loading");
                $.ajax({
                    url: url+param,
                    dataType: 'json',
                    type: 'post',
                    success: function(data) {
                        $(cur_menu_item).removeClass("ajax-loading").addClass("ajax-loaded");
                        $(cur_menu_item).children(".nav-sublist-dropdown").children(".container").html(data['popup_content']).hide().fadeIn();
                    },
                    error: function(){
                        $(cur_menu_item).removeClass("ajax-loading");
                    }
                });
            }
        });
    });
});
<?php endif; ?>
//]]>
</script>